
import twitter
import plurk
                                                                              #

class Microblogger:

    def __init__(self, twitter_username=None, twitter_password=None, \
        plurk_username=None, plurk_password=None, plurk_api_key = None,
        friends_feed_consumer_key=None, friends_feed_consumer_secret=None):

        if twitter_username is not None and twitter_password is not None:
            self.twitter = twitter.Api(twitter_username, twitter_password)
        if plurk_username is not None and plurk_password is not None and \
                                                     plurk_api_key is not None:
            self.plurk = plurk.Plurk(plurk_username, plurk_password, \
                                                                 plurk_api_key)
        return

    def post(self, message):
        if self.twitter is not None:
            self.twitter.PostUpdate(message)
        if self.plurk is not None:
            self.plurk.plurk(message)
        return


